import {Key} from "react"
import { request } from "@/utils/http";
import { hospitalSetType,hospitalSetParamsType,addHospitalParamType,updataHosParamsType,hospitalSetItemType } from './model/hospitalSetType'


export function hospitalSetRequest({page, limit, hosname, hoscode}:hospitalSetParamsType) {
    return request.get<any, hospitalSetType, any>(`/admin/hosp/hospitalSet/${page}/${limit}`, {
        params: {
            hosname,
            hoscode
        }
    })
}

//新建医院请求
export  const addHospitalRequest=(data:addHospitalParamType)=>{
    return request.post<any,null>('/admin/hosp/hospitalSet/save',data)
}
//根据id更新医院信息
export  const updataHosFromIdRequest=(id:string)=>{
    return request.get<any,hospitalSetItemType>(`/admin/hosp/hospitalSet/get/${id}`)
}
//更新医院表单信息请求
export const updataHosRequest=(data:updataHosParamsType)=>{
    return request.put<any,null>("/admin/hosp/hospitalSet/update",data)
}
//根据id删除某一条数据
export const deleteOneRequest =(id:number)=>{
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}
//批量删除请求
export const batchDeleteRequest=(ids:Key[])=>{
    return request.delete<any,null>("/admin/hosp/hospitalSet/batchRemove",{data:ids})
}